<%--
  Created by IntelliJ IDEA.
  User: Langdon
  Date: 2018/2/26
  Time: 16:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>$Title$</title>
  <script>
      function flushCode() {
          // 每次刷新的时候获取当前时间，防止浏览器缓存刷新失败
          var time = new Date();
          document.getElementById("scode").src = "<%=request.getContextPath()%>/getCode?time=" + time;
      }
  </script>
</head>

<body>
  <form action="/validateCodeCheck" method="POST">
    <label>用户名:</label>
    <input type="text"/>
    <br>
    <label>密码  :</label>
    <input type="text"/>
    <br>
    <label>验证码:</label>
    <input type="text" name="code"/>
    <img alt="验证码" id="scode" src="<%=request.getContextPath() %>/getCode" onclick="javascript:flushCode()">
    <br>
    <input type="submit" value="登录"/>
  </form>
</body>
</html>
